package com.example.demo.service;

import com.example.demo.api.CarStation;
import com.example.demo.respository.CarRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CarserviceImpl implements Carservice{

    @Autowired
    private CarRepository carRepository;

    @Override
    public List<CarStation> findAll() {
        return carRepository.findAll();
    }

    @Override
    public boolean UpdateCarON(String PKcode) {
        return carRepository.updateon(PKcode);
    }

    @Override
    public boolean UpdateCaroff(String PKcode) {
        return carRepository.updateoff(PKcode);
    }

    public CarStation Selectcar(String Pkcode){
        return  carRepository.selectPk(Pkcode);
    }
}
